package com.hsgene.discount.constants;

/**
 * @desc:优惠券类型
 * @author: fuxiang
 * @date: 2018/9/21 10:02
 */
public enum DiscountTypeStatus {

    OUTSIDETHEPOLICY(1,"满减"),
    UNDEFINED(-1, "未定义的类型");
    /**
     * 编码
     */
    private final int code;

    /**
     * 描述
     */
    private final String desc;

    public static DiscountTypeStatus getEnum(int code) {
        for (DiscountTypeStatus type : values()) {
            if (type.code==code) {
                return type;
            }
        }
        return UNDEFINED;
    }

    DiscountTypeStatus(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }


}
